package com.shigen.demo.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shigen.demo.entity.BaseUserFile;
import com.shigen.demo.entity.req.BaseUserFileReq.QueryByFolder;
import com.shigen.demo.entity.req.FileFolderReq.CreateFolderReq;
import com.shigen.demo.entity.vo.FileNodeVo;
import java.util.ArrayList;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;

public interface IBaseUserFileService extends IService<BaseUserFile> {

  // 获得文件树
  List<FileNodeVo> listWithTree();

  // 上传单个文件，返回文件的访问路径
  String uploadFile(MultipartFile file, String savePath);

  int uploadFiles(MultipartFile[] files, String parentId);

  IPage<BaseUserFile> getFolderFilesByPage(QueryByFolder queryByFolder);

  List<BaseUserFile> getFolderFiles(String folderId);

  BaseUserFile getFileDetail(Long id);

  // 通过unionId批量删除
  boolean delBatchByUnionId(ArrayList<String> unionIds);

  int reNameFile(Long id, String newName);

  String findByUnionId(String unionId);

  FileNodeVo createFolder(CreateFolderReq createFolderReq);

  boolean move(String unionId, String parentId);
}
